gdkwindow: Update cursor for tablet tools in the window
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 25 Jul 2017 13:37:10 +0000 (15:37 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 26 Jul 2017 11:08:50 +0000 (13:08 +0200)
This check must be done explicitly on Wayland as the master device for
tablet tools differ from the Core Pointer. This ensures that whenever a
tablet tool is inside a window and the cursor is programmatically changed,
it will be visually updated too.

https://bugzilla.gnome.org/show_bug.cgi?id=785375

gdk/gdkwindow.c

index 04f488d2cf098fe35080f36025d1c46129d3a51a..e8f630bd8a91edde0a06c34c00c0c62ca3b25061 100644 (file)
@@ -4588,8 +4588,18 @@ gdk_window_set_cursor (GdkWindow *window,
 
       for (s = seats; s; s = s->next)
         {
+          GList *devices, *d;
+
           device = gdk_seat_get_pointer (s->data);
           gdk_window_set_cursor_internal (window, device, window->cursor);
+
+          devices = gdk_seat_get_slaves (s->data, GDK_SEAT_CAPABILITY_TABLET_STYLUS);
+          for (d = devices; d; d = d->next)
+            {
+              device = gdk_device_get_associated_device (d->data);
+              gdk_window_set_cursor_internal (window, device, window->cursor);
+            }
+          g_list_free (devices);
         }
 
       g_list_free (seats);